﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection;
using System.Text;
using TouchUI;

namespace MobileStore.WinPhone
{
    public class AboutDialog : Dialog
    {
        private int headerHeight;

        public AboutDialog(int screenFactor, Rectangle r)
        {
            Text = Strings.About;
            if(Common.Values.TouchDevice)
                headerHeight = 24 * screenFactor;
            ScreenFactor = screenFactor;
            Rectangle = r;
        }

        public override void Paint(Graphics g)
        {
            g.Clear(BackColor);
            g.DrawImage(Common.Values.DefaultBitmap, new Rectangle(0, headerHeight, Rectangle.Width, Rectangle.Height),
                Rectangle, GraphicsUnit.Pixel);
            if(headerHeight > 0)
            {
                g.FillRectangle(Common.Values.BackBrush, 0, 0, Rectangle.Width, headerHeight);
                g.DrawString(Text, Common.Values.Font, Common.Values.HighBrush, 8 * ScreenFactor, 5 * ScreenFactor);
                g.DrawLine(Common.Values.Pen, 0, headerHeight - 1, Rectangle.Width, headerHeight - 1);
            }
        }

        public override void Resize(Rectangle r)
        {
            this.Rectangle = r;
        }
    }
}
